- page_title '偏好设置'

= form_for @user, url: profile_preferences_path, remote: true, method: :put, html: {class: 'row prepend-top-default js-preferences-form'} do |f|
  .col-lg-3.profile-settings-sidebar
    %h4.prepend-top-0
      程序主题
    %p
      此设置允许自定义本站点的外观和行为，比如边栏。
  .col-lg-9.application-theme
    - Gitlab::Themes.each do |theme|
      = label_tag do
        .preview{class: theme.css_class}
        = f.radio_button :theme_id, theme.id
        = theme.name
  .col-sm-12
    %hr
  .col-lg-3.profile-settings-sidebar
    %h4.prepend-top-0
      语法高亮主题
    %p
      此设置允许自定义语法显示。
  .col-lg-9.syntax-theme
    - Gitlab::ColorSchemes.each do |scheme|
      = label_tag do
        .preview= image_tag "#{scheme.css_class}-scheme-preview.png"
        = f.radio_button :color_scheme_id, scheme.id
        = scheme.name
  .col-sm-12
    %hr
  .col-lg-3.profile-settings-sidebar
    %h4.prepend-top-0
      行为
    %p
      此设置允许自定义系统布局和默认视图的行为。
  .col-lg-9
    .form-group
      = f.label :layout, class: 'label-light' do
        页面宽度
      = f.select :layout, layout_choices, {}, class: 'form-control'
      .help-block
        选择固定 (最大 1200px) 或自适应 (100%) 页面宽度。
    .form-group
      = f.label :dashboard, class: 'label-light' do
        默认仪表盘
        = link_to('(?)', help_page_path('profile', 'preferences') + '#default-dashboard', target: '_blank')
      = f.select :dashboard, dashboard_choices, {}, class: 'form-control'
    .form-group
      = f.label :project_view, class: 'label-light' do
        项目视图
        = link_to('(?)', help_page_path('profile', 'preferences') + '#default-project-view', target: '_blank')
      = f.select :project_view, project_view_choices, {}, class: 'form-control'
      .help-block
        选择访问项目页面时看到的内容。
    .form-group
      = f.submit '保存修改', class: 'btn btn-save'
